<?php
/**
 * Created by laoyu.
 * User: hilaoyu@qq.com
 * Date: 2018/5/22
 * Time: 17:11
 */

namespace Hilaoyu\LaravelExtend\Providers;

use Hilaoyu\LaravelExtend\Services\Files\FileService;
use Hilaoyu\LaravelExtend\Supports\Cli;
use Hilaoyu\LaravelExtend\Supports\SubApp;
use Hilaoyu\LaravelPrivateApi\PrivateApiService;
use Hilaoyu\Utils\UtilCli;
use Hilaoyu\Utils\UtilSupport;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
use SoareCostin\FileVault\FileVaultServiceProvider;

class XcfsClientServiceProvider extends BaseServiceProvider
{

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {


        $this->mergeConfigFrom($this->configPath('xcfs-client.php'), 'xcfs-client');
    }

    public function boot()
    {

        $this->registerRoutes();

    }



    public function registerRoutes(){

        /*$path_prefix = config('xcfs-client.route_path_prefix',"");
        if("" == $path_prefix){
            $path_prefix = "_les/xcfs";
        }

        SubApp::registerRoutes(dirname(__DIR__) . '/Services/XcfsCient/routes/api.api.php','Hilaoyu\\LaravelExtend\\Services\\XcfsCient\\Controllers',["name"=>"l-e-s.xcfs","prefix"=>$path_prefix]);*/



        //Route::getRoutes()->refreshNameLookups();
        //Route::getRoutes()->refreshActionLookups();


        //dd(Route::getRoutes()->getRoutesByName());
    }

    protected function configPath(string $filename)
    {
        return dirname(__DIR__) . '/Services/XcfsCient/config/'.$filename;
    }
}
